﻿@*@model IEnumerable<UscSunShine.Models.Request>*@
@using Webdiyer.WebControls.Mvc

@model IPagedList<UscSunShine.Models.Request>


@{
    ViewBag.Title = "信息审核";
}

<h2>信息审核</h2>

<div id="views">
    <table class="table table-hover table-striped">

        <tr>
            <th>
                @Html.DisplayNameFor(model => model.DepartmentID)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.RequestCategory)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Title)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.AcceptDate)
            </th>

            <th></th>
        </tr>

        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Department.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.RequestCategory)
                </td>
                <td>
                    @*@Html.DisplayFor(modelItem => item.Title)*@
                    @Html.ActionLink(item.Title, "Details", new { id = item.ID })
                </td>

                <td>
                    @Html.DisplayFor(modelItem => item.AcceptDate)
                </td>

                <td>
                    @Html.ActionLink("审核", "Edit", new { id = item.ID }, new { @class = "btn btn-warning btn-sm" })
                    @Html.ActionLink("删除", "Delete", new { id = item.ID }, new { @class = "btn btn-primary btn-sm" })
                </td>
            </tr>
        }

    </table>
    @Ajax.Pager(
    Model,
    new PagerOptions
    {
        PageIndexParameterName = "index",
        ContainerTagName = "ul",
        PagerItemWrapperFormatString = "<li>{0}</li>",
        CurrentPagerItemWrapperFormatString =
        "<li class='active'>" +
        "<a href='#'>{0}" +
        "<span class='sr-only'>(current)" +
        "</span></a></li>"
    },
    new MvcAjaxOptions
    {
        UpdateTargetId = "views",
        EnablePartialLoading = true
    },
    new { @class = "pagination" }
)
</div>
@section Scripts{@{Html.RegisterMvcPagerScriptResource();}}